package toolz;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

import GUI.ChartTools.WBRG_PaintScale;

public class HeatTableCellRenderer extends DefaultTableCellRenderer {

	public static final long serialVersionUID = 1L;
	
    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
            boolean hasFocus, int row, int column) {
        Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        try {
            if (true) {
                double valueD = Double.parseDouble(value.toString());
                WBRG_PaintScale ips = new WBRG_PaintScale(0, 40);
                cell.setBackground((Color)ips.getPaint(valueD));
            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return cell;
    }
}